const express = require('express')
const router = express.Router()

const {
    getUserListService,
    delUserLoginService,
    addImageService
} = require('../service/userService')

router.get('/userList', async (req, res) => {
    let userList = await getUserListService()
    res.send(userList)
})
router.post('/login', async (req,res) => {
    let body = req.body
    let result =  await delUserLoginService(body)
    //   /assets/img/avator.jpeg
    res.send(result)
})
router.post('/upload',async (req,res)=>{
    let body = req.body
    let result = await addImageService(body)
    console.log(result+"router")
    res.send(result)
})
// router.post('/saveImg', async (req, res) => {
//     let body = req.body
//     console.log(body)
// })
module.exports = router